fix a sylpheed crash
authorMatthias Clasen <matthiasc@src.gnome.org>
Fri, 8 Sep 2006 20:02:45 +0000 (20:02 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 8 Sep 2006 20:02:45 +0000 (20:02 +0000)
ChangeLog
gtk/gtktextbuffer.c

index 6bf656c0437f5878242a614811cc1b34c4dfbdb2..12f042d86753a72ca1b5b1e3cf4c6c81e7d9a574 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-09-08  Matthias Clasen <mclasen@redhat.com>
 
+       * gtk/gtktextbuffer.c (remove_all_selection_clipboards):
+       Don't clear clipboards here, since we are called from finalize
+       and can't emit signals.
+
        * configure.in: Set version to 2.11.0
 
 2006-09-06  Richard Hult  <richard@imendio.com>
index 3de0d792086ed0809c70f810f8f20d0f63b01df5..e933fc0e6139f951720a558f5e693d2db701954f 100644 (file)
@@ -567,10 +567,10 @@ gtk_text_buffer_finalize (GObject *object)
 
   buffer = GTK_TEXT_BUFFER (object);
 
-  remove_all_selection_clipboards (buffer);
-
   priv = GTK_TEXT_BUFFER_GET_PRIVATE (buffer);
 
+  remove_all_selection_clipboards (buffer);
+
   if (buffer->tag_table)
     {
       _gtk_text_tag_table_remove_buffer (buffer->tag_table, buffer);
@@ -3509,19 +3509,7 @@ gtk_text_buffer_remove_selection_clipboard (GtkTextBuffer *buffer,
 static void
 remove_all_selection_clipboards (GtkTextBuffer *buffer)
 {
-  GSList *tmp_list = buffer->selection_clipboards;
-  while (tmp_list)
-    {
-      SelectionClipboard *selection_clipboard = tmp_list->data;
-      
-      if (gtk_clipboard_get_owner (selection_clipboard->clipboard) == G_OBJECT (buffer))
-       gtk_clipboard_clear (selection_clipboard->clipboard);
-      
-      g_free (selection_clipboard);
-
-      tmp_list = tmp_list->next;
-    }
-
+  g_slist_foreach (buffer->selection_clipboards, (GFunc)g_free, NULL);
   g_slist_free (buffer->selection_clipboards);
   buffer->selection_clipboards = NULL;
 }